package chapter6.chapter6_13;

public class ThisDemo01 {
    public static void main(String[] args) {
        Student xuGan = new Student();
        System.out.println(xuGan.getName()); // 输出:徐干       System.out.println(xuGan.getAge());// 输出:21       System.out.println(xuGan.getSex());// 输出： 男  }
    }
}
class Student{
        private String name ;
        private int age ;
        private char sex ;

        public Student() {
            // 很弱，我的兄弟很牛逼啊，我可以调用其他构造方法：Student(String name, int age, char sex)       this("徐干",21,'男');
        }

        public Student(String name, int age, char sex) {
            this.name = name ;
            this.age = age   ;
            this.sex = sex   ;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        public char getSex() {
            return sex;
        }

        public void setSex(char sex) {
            this.sex = sex;
        }
}